﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

  <table data-toggle="table" class="table table-striped table-hover">
   <thead>
     <tr>
       <th data-align="center">门店</th>
       <th data-align="center">课程</th>
       <th data-align="center">学员</th>
       <th data-align="center">教练</th>
       <th data-align="center">上课时间</th>
       <th data-align="center">签到时间</th>
       <th data-align="center">签到人</th>
     </tr>
   </thead>
   <tbody>
     <c:forEach var="finishedSchedule" items="${finishedSchedules}">
       <tr>
         <td>${finishedSchedule.site.name}</td>
         <td>${finishedSchedule.course.categoryName} <br /> ${finishedSchedule.course.name}<c:if test="${!finishedSchedule.course.year}">(课时：${finishedSchedule.course.hours})</c:if></td>
         <td>${finishedSchedule.student.name}<br />${finishedSchedule.student.mobile}</td>
         <td>${finishedSchedule.coach.name}</td>
         <td>
           <fmt:formatDate value="${finishedSchedule.occurDate}" pattern="yyyy-MM-dd"/>&nbsp;&nbsp;${finishedSchedule.occurHour}
         </td>
         <td>
           <c:choose>
             <c:when test="${not empty finishedSchedule.signinTime}">
               <fmt:formatDate value="${finishedSchedule.signinTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
             </c:when>
             <c:otherwise>
               补签：${persist.courseScheduleAttribute(finishedSchedule)['signin_time'].value}
             </c:otherwise>
           </c:choose>
         </td>
         <td>
           ${persist.courseScheduleAttribute(finishedSchedule)['signin_person_name'].value}
         </td>
       </tr>
     </c:forEach>
   </tbody>
  </table>

  <div class="form-horizontal clearfix" style="margin-top: 20px;">

    <div class="form-group pull-left" style="width: 60%">
      <label class="control-label col-xs-3">查询总计：</label>
      <div class="col-xs-4" style="padding-left: 0px;">
        <p class="form-control-static">${total}条记录</p>
      </div>
    </div>

    <jsp:include page="/WEB-INF/include/page.jsp">
      <jsp:param name="url" value="finished-course-reports/common-grid" />
      <jsp:param name="queryString" value="${queryString}" />
    </jsp:include>

  </div>

  <script>
  $("#grid-wrap table").bootstrapTable({
    height: 350,
    striped: true
  });
  </script>
